#include<bits/stdc++.h>
using namespace std;
const int N=1e5+10;
int a[N],n;
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        scanf("%d",&a[i]);
    }
    sort(a+1,a+1+n);
    int cankill=0,cnt=0,la=0,ans=0;
    for(int i=1;i<=n;i++){
        if(la!=a[i]){
            la=a[i],cankill+=cnt,cnt=0;
        }
        if(cankill)cankill--,ans++;
        cnt++;
    }
    printf("%d\n",n-ans);
    return 0;
}
